package com.qyc.controller;

import com.qyc.service.LogService;
import com.qyc.utils.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @className: LogController
 * @Description:
 * @author: qinyc
 * @date: 2023/6/21 17:04
 * @version: v1.0
 */

@Api(tags ="日志模块")
@RestController
@RequestMapping("/log")
public class LogController {

    //注入日志Service层对象
    @Autowired
    private LogService logService;

    /**
     * @Author qinyc
     * @Description  分页多条件查询日志信息
     * @version: v1.0
     * @Date 17:32 2023/6/21
     **/
    @ApiOperation("分页获取日志信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageNum",value = "当前页码"),
            @ApiImplicitParam(name = "pageSize",value = "每页大小"),
            @ApiImplicitParam(name = "originalIp",value = "源IP")
    })
    @GetMapping("/page")
    public ResponseResult logPage(Integer pageNum,Integer pageSize,String originalIp){
        return logService.logPage(pageNum,pageSize,originalIp);
    }
}
